package vip.xiaonuo.biz.modular.pojo.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import vip.xiaonuo.biz.modular.lancerCoupon.entity.BizCoupon;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.common.pojo.DbEnum;

/**
 * 商品盒子表
 *
 * @TableName biz_goods_box
 */
@TableName(value = "biz_goods_box")
@Getter
@Setter
@Accessors(chain = true)
@IndexName(value = DbEnum.ESIndex)
public class BizGoodsBox extends CommonEntity implements Serializable {
    /**
     * 商品盒子id
     */
    @TableId
    @IndexId
    private String id;

    /**
     * 品牌方id
     */
    @IndexField
    private String brandId;
    @IndexField
    private String categoryId;
    @IndexField

    private String brandName;

    @IndexField(value = "curr_energy")
    private Integer currEnergy;
    /**
     * 商品盒子名称
     */
    @HighLight(preTag = "<em style='color:red'>", postTag = "</em>")
    @IndexField(value = "goods_box_name",fieldType = FieldType.TEXT,
            analyzer = "my_analyzer",
            searchAnalyzer = Analyzer.IK_SMART)
    private String goodsBoxName;

    /**
     * 商品盒子详情
     */
    @IndexField
    private String goodsBoxDetail;

    /**
     * 盒子封面
     */
    @IndexField
    private String goodsBoxImgUrl;

    /**
     * 售价
     */
    @IndexField
    private Integer goodsBoxPriceFee;


    @TableField(exist = false)
    @IndexField(exist = false)
    private List<BizCoupon> couponList;


    // TODO 拼音补全
    @TableField(exist = false)
    @IndexField
    private List<String> suggestions;

    @TableField(exist = false)
    @IndexField
    private String all;
}